/****** Object:  Stored Procedure dbo.spr_UpdateDBDriversByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateDBDriversByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateDBDriversByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateDBDriversByPK]
 (
	@compid int,
	@dob datetime,
	@driverid int,
	@drivername varchar(50),
	@fathername varchar(50),
	@hourperweek int,
	@is3rdparty bit,
	@isactive bit,
	@licexpiry smalldatetime,
	@licid varchar(20),
	@licpointsleft tinyint,
	@nicno varchar(20),
	@passportno varchar(25),
	@visaexpiry smalldatetime,
	@visaid varchar(20),
	@wageperhour decimal(6,
 2)
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [Drivers]
	SET
		[CompId] = @compid,
		[DOB] = @dob,
		[DriverId] = @driverid,
		[DriverName] = @drivername,
		[FatherName] = @fathername,
		[HourPerWeek] = @hourperweek,
		[Is3rdParty] = @is3rdparty,
		[IsActive] = @isactive,
		[LicExpiry] = @licexpiry,
		[LicId] = @licid,
		[LicPointsLeft] = @licpointsleft,
		[NICNo] = @nicno,
		[PassportNo] = @passportno,
		[VisaExpiry] = @visaexpiry,
		[VisaId] = @visaid,
		[WagePerHour] = @wageperhour

	WHERE
	[CompId] = @compid
	AND [DriverId] = @driverid


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

